package MyBlog.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import MyBlog.biz.ArticleBiz;
import MyBlog.dao.ArticleDao;
import MyBlog.entity.Article;

@Service("articleBiz")
public class ArticleBizImpl implements ArticleBiz {

	@Autowired
	private ArticleDao articleDao;
	
	public List<Article> getListByClicks(int pageSize) {
		return articleDao.getListByClicks(pageSize);
	}

	public List<Article> getListByUpdateTime(int pageSize) {
		return articleDao.getListByUpdateTime(pageSize);
	}

	@Override
	public List<Article> getListByUserIdAndCid(int cid ,int userId, int pageNum, int pageSize) {
		return articleDao.getListByUserIdAndCid(cid,userId, pageNum, pageSize);
	}

	@Override
	public int getRowsByUserId(int userId,int cid) {
		return articleDao.getRowsByUserId(userId,cid);
	}

	@Override
	public List<Article> getClicksListByUserId(int userId, int pageSize) {
		return articleDao.getClicksListByUserId(userId, pageSize);
	}

	@Override
	public Article fetchArticleById(int articleId) {
		return articleDao.fetchArticleById(articleId);
	}

	@Override
	public List<Article> getListByCidAndtitle(int cid, String title, int userId) {
		return articleDao.getListByCidAndtitle(cid, title, userId);
	}

	@Override
	public void update(Article article) {
		articleDao.update(article);
	}

	@Override
	public void add(Article article) {
		articleDao.add(article);
	}

	@Override
	public void delete(int articleId) {
		articleDao.delete(articleId);
	}

}
